package edu.calvin.djs32.cs214.interpreters.calculator.primitives;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import edu.calvin.cs214.hobbes2008.IntegerTIR;
import edu.calvin.cs214.hobbes2008.StringTIR;
import edu.calvin.cs214.hobbes2008.TupleTIR;


public class LessThanPrimitiveTest {
	@Test
	public void shouldApplyIntegers(){
		assertEquals(new StringTIR("true"), new LessThanPrimitive().apply(new IntegerTIR(2), new IntegerTIR(3)));
		assertEquals(new StringTIR("true"), new LessThanPrimitive().apply(new IntegerTIR(-2), new IntegerTIR(33)));
		assertEquals(new TupleTIR(), new LessThanPrimitive().apply(new IntegerTIR(-2), new IntegerTIR(-3)));
	}
	
	@Test
	public void shouldApplyString(){
		assertEquals(new StringTIR("true"), new LessThanPrimitive().apply(new StringTIR("foo"), new StringTIR("fooo")));
		assertEquals(new TupleTIR(), new LessThanPrimitive().apply(new StringTIR("foo"), new StringTIR("fo")));
	}

}
